package com.sdstc.modules.vo;

import lombok.Data;

import java.io.*;

/**
 * 架构调整初始页面数据类
 */
@Data
public class OrgAdjustVo implements Serializable{
    //编制总数
    private Integer prepareTotal;
    //实际人数
    private Integer actualNum;
    //超编总数
    private Integer overTotal;
    //内设机构
    private OrgTypeVo internalList;
    //下设机构
    private OrgTypeVo consistsList;
    //派出机构
    private OrgTypeVo sendList;
    //事业机构
    private OrgTypeVo careerList;

    public OrgAdjustVo deepClone(){
        OrgAdjustVo orgAdjustVo = null;

        try {
            // 写入字节流
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(baos);
            oos.writeObject(this);

            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            ObjectInputStream ois = new ObjectInputStream(bais);
            orgAdjustVo = (OrgAdjustVo) ois.readObject();
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }

        return orgAdjustVo;
    }


}
